<template>
  <div>
    <div class="cdk-card">
      <div class="cdk-box">
        <div class="cdk-header">
          <div class="activation">激活码兑换</div>
          <div class="exchange" @click="$router.push('/userinfo/code_record')">兑换记录></div>
        </div>
        <div class="cdk-input">
          <input type="text" placeholder="输入激活码" v-model="giftCode">
          <button>确认</button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
// import {getPostJson} from '../../../network/post'

export default {
  data() {
    return {
      giftCode: '',
    }
  },
  methods: {
    // exchangeClick() {
    //   var url = '/user_exchange_gift_code'
    //   var data = {
    //     'code_v': this.giftCode,
    //   }
    //   var token = localStorage.getItem('token')
    //   if(token) {
    //     getPostJson(url, data).then(res => {
    //       // this.message = res
    //     console.log(res);
    //     if(res.status == 'ok') {
    //       this.$emit('change-info')
    //       this.$store.commit('$_activationShow', true)
    //       this.$store.commit('$_activationInfo', res)
    //     }else{
    //       this.$store.commit('$_activationShow', true)
    //       this.$store.commit('$_activationInfo', res)
    //     }
    //   this.giftCode = ''
    //   })
    //   }
    // }
  }
}
</script>

<style scoped>
.cdk-card {
  margin-top: .266667rem;
  padding: 0 .426667rem;
}

.cdk-box {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 9.146667rem;
  height: 2.586667rem;
  background-color: #ffffff;
  background: url('../../../assets/img/my/ic_bg.png') no-repeat;
  background-size: 9.146667rem 2.586667rem;
  border-radius: .213333rem;
  padding: .266667rem;
}

.cdk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: .6rem;
}

.cdk-input {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 1.173333rem;
}

.activation {
  font-size: .426667rem;
  font-weight: 800;
  color: #FF5543;
}

.exchange {
  width: 2.04rem;
  height: .613333rem;
  border-radius: .306667rem;
  background: #fff;
  line-height: .613333rem;
  text-align: center;
  font-size: .32rem;
  font-weight: 400;
  color: #FF5543;
}

.cdk-input input {
  outline: none;
  border: 0;
  background: #f8f8f8;
  width: 6.506667rem;
  height: 1.013333rem;
  border-radius: .213333rem;
  line-height: 1.013333rem;
  text-indent: .133333rem;
  font-size: .4rem;
}

.cdk-input button {
  outline: none;
  border: 0;
  width: 1.84rem;
  height: 1.013333rem;
  opacity: 1;
  margin-left: .266667rem;
  background: #ff5543;
  border-radius: .266667rem;
  font-size: .373333rem;
  font-weight: 400;
  text-align: center;
  color: #ffffff;
  line-height: 1.013333rem;
}
</style>